Split into library, executable and test-suite

It's probably a good idea to split this package into a library -- containing the algorithm -- and an executable -- containing the user interface and I/O code -- and a test suite.