some assertions, cleanup, tests. working on dom renderings