Add JavaDoc for public API

Fixes #2