Style fixes.
Make cache more generic to fix include issues.

Now we don't need to worry about the order we include cache.h,
since node_idx, level, and arc_idx are only used internally by
forest.h and forest.cpp.
Modify spacing.
Fix API so ITVal can use it.