Now handles multiple js files in data dir, and used preg_replace_callback due to deprecated e modifier