Update replace.js

Bail out early if there are no matches, preventing an exception caused by applying an array object onto a null object.
Update replace.js

properly count valid files. exit when all of them have been evaluated.
Update replace.js

Fix incorrect reference to `modulePath`. By the time it is referenced, its parent object `file` has already been reassigned to a string.
Merge pull request #95 from airtonix/master

Update replace.js