Improved #includes, added slug_free error checking

Added check in slug_free if the pointer bring freed is not the first
byte of a malloc'ed block.

Removed bugs with strdup.
Cleaned up ordering/formatting.
Added debug prints to all functions.