added validation and sanitizing functions for mitigating RCE vulnerabilities
added better escaping to URLs
Merge pull request #29 from opentechinstitute/fix-RCE

Added validation and sanitizing functions for mitigating RCE vulnerabilities. Successfully tested by @jheretic in conjunction with opentechinstitute/luci-commotion-apps#21.