Misc. fixes.
Added tier2.
Added assertions (tier2).
Added signals and exceptions (tier2).
Added logging (tier2).
Added debug information (tier2).