Split complexity type/helpers to own file

This code is currently duplicated, and there even was an optimization missing in one copy (namely, mult 0 Unknown = 0 in one version, and mult 0 Unknown = Unknown in the other)