Refactor tests into module, run with unittest runner