New back-end tests

Refactor, new tests, fixes. Use 'request' module instead of 'http'