check if Crafty.canvas has been initialized before manipulating it; refactor tests