Properly skip the first object field that is a function when encoding object in JsonPrinter (closes #2955).

Also add tests for haxe.format.JsonPrinter/Parser so we can specify it's behaviour further.