Trying to make ScalaTests pass. Removed some global variables, added some lazyness on solution processing, some refactoring. Still work to do.