Fix packaging and get a simple form of the library running as a script.