Basic refactoring done, code changed

docs and tests not updated yet
Fixed tests with the new error returning structure
Update docs + small fixes
Merge branch 'feature/better-error-returning' into develop