The order and way include macros were structured was chaotic, with no real common thread between files. Try to tidy up the mess with some common scheme, to make things look less messy.
This is basically a copy of the implementation currently residing in src/core/delete.c, which will be eventually deleted in favor of this one. https://bugzilla.gnome.org/show_bug.cgi?id=711619