Outsource tests to a test/ directory

The lib/ directory is now cleaned from tests. Those live and run in the
test/ directory in the source tree root now.