Strong typed data structures in javascript