Only update output file if compiled source changes

Check should be done by comparing source files rather than the compiled
output but this is easier for now and doesn’t require another cache.

The only reason this is added is that when saving multiple file mods happen.
An even better solution would be to do a secondary check on the file
to ensure its not a duplicate update and no contents have changed.
Refactor handling of file events
Add -w flag to monitor file changes without starting the file server