Updated the pom.xml with fileds needed for a release.
Ensure connections are always closed, and reformatted some code.