altoslib: Add JSON-based object saving/restoring code