Clean and update build output more intelligently

Fixes #183.
a single line comment would be more obvious here - this looks like a javadoc at first (and its definitely not a javadoc)