Added test for omlibrary directory. Cleaned up code. Included doctest.

This is for #25.