Refactor testplans actions

Move CasesActions from testplans.views.cases view method out to standalone actions.py module. This helps to simplify that view and make it more readable.

Also, fixed wrong response type when return JSON data.