Added new InvalidJsonError class for handling errors in JSON input.
This is better practice than just (ab)using StandardError.