Fully implement init-decl.
Also added debug logging facilities.