move scripts into objects to make them testable.  Lots of refactoring.  Set up sbt. moved into a package to be able to move out common functionality into a package object later.