Add options to repair or change file system

Change-Id: I9043e98e1e1ed4722f05c13a60b43d2d0bf739f6
Whitespace and minor code cleanup

This is by no means comprehensive, but is quite a bit better already.

Change-Id: Ibc8654a5dfb0eec39cbd0b64bdb52bb4fbfe2f7e