Some additions to make my life easier in some places.

Also add a sample client
Also change some throws NPE into throws IAE, which I personally find more appropriate.