Time2test

Adds tests and code formatting.