Move scripts into lib/ directory