Add typing API and unit tests. Not hooked up yet.