Typescript-backbone: trim text input

Fix for #817