Make compiler warnings errors.

(and fix a few warnings)
Move public API to Java.

Closes #24.