Turned on optimizations in Makefile
Refactored to use dynamic structures, allowing multiple caches, etc