Improved logging

# Also refactored definitionTypes to have toString methods