Make all tests pass, move source into one file