Clean and update build output more intelligently

Fixes #183.
It seemed like this pattern would be something worth breaking out (since it's used in other places), but I wasn't sure the best way to go about it. Maybe adding a method to TypeScriptProjects to get a project preference store? It doesn't seem like it'd save that much space though...