Clean and update build output more intelligently

Fixes #183.
?

As in, don't use braces for a one-line block? Or the line should be `} else {`?

Ahh, just saw the latter elsewhere. Sorry, didn't notice that, will change.