Improved reflection. Basic JSON encoding is working now.