Move pynut into lib