Added license and readme and moved library code into lib.go