js mvc with types