Rework how vectors and maps are bound: add bounds checking and return undefined if out of bounds.