Fix attachment filename and title scrubbing

Fixes https://www.pivotaltracker.com/story/show/59031842

- [x] Add tests which assert the state of the database after scrubbing
- [x] Get database name, username and password from the app rather than hardcoding them