Clean and update build output more intelligently

Fixes #183.
Ahh, good catch. I think I originally had this method static or something and needed it passed it. I'll fix it.