Adding basic input parameter checking for exported functions.
"max_sizes" parameters fixed some bugs. the cache manager is now tested and validated (now, it's time for the glyph image cache)