Implement ToNodeCache and FromNodeCache.
Refactored caching.
Merge branch 'implement-node-caching' into develop