Task Loader

Rewrite task loader and memory allocation