Simplify for safer transforms

Use JSON.stringify instead of manually escaping, closes #1
Use Array.indexOf to check for (case-insensitive) file extension, closes #2
Merge pull request #6 from holic/master

Simplify plugin for safer transforms