First pass at the library with an example java app.