Added some tests and docs.