Added comments and a fix for Prototype's toJSON methods