Add KhanUtil.kmatrix, tests for kmatrix/kvector

Test Plan: see tests/k*.html

Auditors: alex