[0.6] Less unstable memory management
+Added local counting for allocation and deallocation ops
*Primitive and unfinished memory management proved to be not that 
 unstable
*Fixed the bugs that popped up out of nowhere in the last commit