Convert to library package, and add tests.
readme file