Add tests for ureport & attachment processing, fix minor issues found

Closes #209.