Remove paths from temp and core folders right before returning the response.
Added missing return statements.
Edited regex for filenames matching.
Use pathRemover function  to remove compiler dir from output instead of str_replace.