More awesome debugging

Added even more debugging lines for better logging. Changes to the
logger thanks to Cruncher's suggestions.