Update to Java 8, refactored to use lambdas and Stream API.

Closes #7