Ensure allocated memory is aligned and add missing 'gt'.
Remove the crappy custom allocator and use halloc in its place.