added tilecache, and file tests.
major refactor mostly complete
forgot most of the changes
naming consistency, smt now had factory functions
more cleaning
fixed minor errors
cleaned up changes