Fixed most PEP8 errors on the backend.
Fixed error causing the cached _schema to not be updated.

- This was causing conflicts between tests, causing some to fail
  by that.
Improved tests code (PEP8 and repeated code).