Added memory management malloc functions
Added memory management malloc functions
General updates, little gub fixes and cleaned source