Extract test functionality

Fix #101.
Let’s leave it as is, then.