Refactoring of some return values
Tidy the tests
Use a while loop rather than a c-style for loop
Get ride of an unnecessary StringBuilder
Moved tests to approriate package
Remove some unnecessary StringBuilders
Don't swallow IOException.