Revert "Remove Core.Debug"

This reverts commit 5b60da390754b52e4ab4701e7fd78736d82976bb.

Conflicts:
	lib/core/sys.ex
	test/core/sys_test.exs
Switch to xgen api - except debug options
Tidy tests

Remove leftover :base references
Fix ununsed variable warning