Moved handler into core library for test use.
Create first propert test cases.

At the moment it isn't checking the actual content, just the
headers. But it's enough to check a few of the first cases
of the map check.