Moves caching to head.cpp
Merge pull request #41 from kevinchabreck/cleanup

Moves caching to head.cpp