move testing code to tests/
Merge pull request #1239 from tburette/init-test-fix

Dependency on mock causes crash on init