Initial implementation multitasking JB, also variouse fix for memory leaks in activity manager