Build on 7

@Sanne Here is the change which does the required changes for building with Java 7, maintaining compatibility to Java 6. Feel free to pick these commits into your branch and close this PR thereafter, however it works best for you.