UrlEncode fix for input strings > 32766 limit

Initial code by @jeffthieleke-wf with my additions of null parameter
check, correct maxLength of 32766, and matching indentations per
@Haacked.
Unit Tests for UrlEncode limit fix
Merge pull request #440 from robertmiles3/escapedatastring-limit-fixer

UrlEncode fix for input strings > 32766 limit