Fix #544: Space after document causes validation error
 - error messages for JSON validation could still be greatly improved
Merge pull request #568 from stennie/issue-544

Fix #544: Space after document causes validation error