core: restructure global include file

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
core: add max_t macros and friends

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>