Add unit tests for parsing of incoming data.

Uses actual data from API documentation and proper API calls.

Also restructures internal namespaces a bit.