Updated str_replace method to remove reserved JS method names.
Fix semicolon errors resulting in invalid js when using agressive jsmin.