sped up json string parsing

should now be 100x faster thanks to regular expressions and less stupidity.
catch Java "out of heap space" errors

I am using a java function to encode/decode base64, which will overflow
the java heap if given too much data. Worse yet, it will not free that
memory after throwing the exception. This prevents base64
encoding/decoding if the base64 string would not fit into memory.

Increase your heap space if you want to send larger data.