Update readme, and move code into /lib