Added a wrapped exception because Java 8 doesn't handle this stuff properly.
More stuff I couldn't get rid of.
Added a few simple tests.