Write all the backends, refactor a ton of stuff