Cleaned up custom JSON serialization (WIP)