ai: make functions static inline
headers: reformat inclusion guard

It's nicer
masks: move to .c file
masks: unify mask creation process

Pretty cool stuff