More work on JSON support. Everything seems to be working now.