Minimum working version.

Now with tests!