Added a very dirty caching algorithm. Speeds up my program byabout 70%.

Will clean up later.
Merge pull request #15 from shadowpho/ecs2

Added a very dirty caching algorithm. Speeds up my program byabout 70%.