Model unit as an object

Fixes #96