Got the layout for kma_malloc and many of its subfunctions written. Currently compiles with no warnings or errors.