Clean and update build output more intelligently

Fixes #183.
this isn't the proper bracing style for this project