Fix TS0.9.11 compile error

Typescript Error Message error: Generic type references must include
all type arguments
Fixing for 'declare' modifier not allowed for code already in an ambient context.
Spelling Accounts and Template fix
added .toString(), otherwise [object Object] was stored.
Merge pull request #1 from teyrow/master

Some bugfixes to make it compile with TS 0.9.1.1