Refactor console abstraction and include console.assert