Add library tests

There are definitely opportunities for refactoring and improving the code and the API with the UI here but those changes can wait for another day.
-Mark