Improve testing routine

Separate unit tests into modules.