fixed some bugs in nested cjsx contexts, moved test cases out into separate files