write some tests

Refactoring the code (and it really needs it) is impossible because there are no tests, so I implemented some. A couple are marked as pending because I'm not familiar enough with puppet to know how to implement them properly.

Not anywhere near good coverage, but at least better than it was. Hopefully, this will make it easier to decide that PR #41 is good.