Added memory for context structs, adjust related_init functions
Completed first pass macros layout