[i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] long
This brings us in to line with Linux definitions, and also simplifies
adding x86_64 support since both platforms have 2-byte shorts, 4-byte
ints and 8-byte long longs.
Split debug functions out into core/debug.c, so that they can be
automatically linked in on demand.
Corrected warnings in misc.c. strtoul() really should be
unsigned long strtoul ( const char *p, const char **endp, int base )
but such is not the ANSI standard.