Started moving scripts to modules so that they can be tested