restructured for sbt building. some clean up. demo seems to be working. most tests pass (not all)