Build speed improvements.

Refactor build tasks to use shared functionality for iterating files matched by filesets, and for writing content to files.  Use a state file to track whether comments have been removed from shader source.