Major code refactor after C++ re-write

After doing a C++ re-write of this game, I've noticed some issues with
the C version. The C++ re-write forced me to do a major review of the
C version (so I could know what/how to re-write).

Basically some bugs were fixed and I've had an idea for an error
handling system which is implemented through a set of macros and helper
functions (check error.h and error.c).

Error handling now doesn't depend so much on cascading labels and clever
goto stuff. It still involves gotos here and there, but it's bread and
butter is something else.