Added pointfree style implementation and tests.