Lots of changes in render to support a correct json output - also, started to move expected part to external files