Closes #5 Added functional tests.