Lots of cleanup, including: Make full use of new Java 8 features, remove redundant casts, improve & fix JavaDocs, remove unused imports and more
Fix the client