Moved converter to separate module

The parsing of JSON input and converting internal representation to other
types are separate concerns, so they have been separated.