[#1]: Fixed logic of determine_unit_and_type

Fixed implementation of determine_unit_and_type, added unit test for it.
Merge branch 'master' of github.com:rossbayer/maxify

Amending previous commit after push