Refactored JsonScanner to include more explicit exception classes.