Some bug fixes to work on linux and windows.
Also starting to fiddle with the idea of a cli.