Add a basic unit test.

It's a bit pointless now, but will be more useful later.
Refactor linting into library.
Make test more useful by covering Check only.