Finished implementation of macro. Added new tests.