Refactored out generalized from generalized utilities, added c-style logging, further tweaking for #inclues trimming