Debug view rewrite. Still incomplete, but a subset is functional.