Moved code to lib/ directory.