added tests, updated error checks and grunt logging, writing files with unexistent folders