Added tests and updated it here'n'there.

I also plan to add some documentation later.