Extract tests to a separate crate

This ensures that we're only testing public API and speeds up the
development process.