Encoder bugfix for numeric strings.

Fixed bug in encoder which caused it to handle strings which
coerced to numbers incorrectly. Added unit test.

Cleaned up a few minor declaration comma vs. semi-colon issues.