Changed from java6 (master) merged into java7

@nebulorum - I've created this as a continuation from pull request #10 ('Update version 2.0 & scala to 2.11'). Can you look at this once that has been merged in.  This takes the changes that have been made in java6 branch (aka, master) and updates the java7 branch.