Fixed Javascript replacing strings only once.
Merge pull request #4 from vcelis/issue_2_fixes

Fixed Javascript replacing strings only once.