Consolidate functions.c and version.c; add flags boundary checking.

Moved functions from version.c to functions.c and removed surplus
file, plus added boundary check when setting new flags (libmagic
does not have it and will never report an error, even if you set
flags to 0xffffff or else.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Move bits of TestMagic_Flags() into TestMagic_SetFlags(), plus add more tests.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>