Cleanup backend from hacks

**DO NOT MERGE YET**
Almost ready cleanup branch, open pullreq to review the progress so far.