Added code and tests and updated README.

Signed-off-by: Euan T <euantorano@gmail.com>