Changed the JSON encoding to return strings, numbers, etc as simple values.
Simplified the optionalBoolean method with a Lua 5.x macro.