Context helper improved, avoid 500 instead of 404

* context.has_ctx() helper has been added
* has context check added to teardown to avoid 500 instead of 404

Fixes bug: #1198099

Change-Id: I198e73637fe4b973d2d99873d66cf5ddd49a43e3
Support of different content types cleaned

Fixes bug: #1197530

Change-Id: Ic4024eb2016310aae69dca4c9bb3726d8baf02bc
Merge "Context helper improved, avoid 500 instead of 404"
Merge "Support of different content types cleaned"