Using java7 features

No big changes. I only changed some code to use Java 7 features like diamonds, removing some warnings, etc.