Implement the testmode.

Resolve #11