First implementation in TypeScript.
Added a demo page.