Got macro system working (although still a bit hacky, should probably be cleaned up).