Tidying up, tying to SI units

Grouped likeminded code into tabs, invented functions to assist with
decluttering main body of code.

Implemented auto-conversion between SI units and simulator units
(pixels,frames), even remains correct with resolution changes! VERY
HAPPY