Added buffering to REORDER_HACK and various string, alloc, etc checks
Also fixed reorder logic and a few comments