677 add version number to xform and endpoint to replace a form

closes #677 and #542 
If we do not get `survey` as an instance of the `XForm`, which means an error may have occured, the serializer is not initialized. Add tests for this.

```python
  File "./onadata/apps/api/viewsets/xform_viewset.py", line 797, in partial_update
    return Response(serializer.data, status=status.HTTP_200_OK,

UnboundLocalError: local variable 'serializer' referenced before assignment
```