Reworked the structure for the MLA extension to make it more logical
Added atbeginend package to support advanced environment logic