replace map with deftype object

+some style fixes
distance func tests
fix README