First draft of new java api.
Second part
Third part.