returns a promise, fixes #2, with unit tests, fixes #10
updated changelog