Lots of javadocs, some refactoring (renamed callback to continuation)