Some reformatting in test module, made it java 1.7, and updates to use try-with-resources feature where applicable