Build JavaScriptFold objects from its Json representation.  Also fixed some bugs and added tests.