Code cleanup: fixes based on findbugs 3.0 findings

Running findbugs 3.0 on the code base provided some useful
cleanup suggestions, and some direct bugs which should be fixed.
This commit fixes the most obvious ones, there are still some
findbugs findings left that should be investigated more.
Findbugs: add findbugs reporting
Code cleanup: more fixes based on findbugs findings

Fixes based on findbugs reports.
Update junit version, and add junit test for Utils class.
Merge pull request #92 from alfh/fix_findbugs_findings

Code cleanup: fixes based on findbugs 3.0 findings