Renamed some macros, added docstrings.
Used new macros/macro names.
Added more unit tests.
Moved util functions into own module.