Add harmony function

Added harmony method to API. Tests for all cases provided in the
tester.js file.