Add validation for number params

Remove trim call for parsed[opt] as it is causing exception when the passed argument is not string. Add validation for null value, undefined value - if such is passed to a parameter, that should be string, the process is stopped. Add validation for strings - use isNullOrWhitespace function to check if the passed string is valid. Add validation for numbers - if the passed argument is number and it is NaN or Infinity, the process is stopped.

http://teampulse.telerik.com/view#item/276923
This code is duplicated here and in `helpers.ts`. Do you need it on both places?