Move ruby scripts to lib