Changes for #234 and more.
  - changed occurrences of .equals("") to use .length() instead.
  - Fixed random test failures where test cases expected post data to come in one chunk - this may not always be the case.