Finish backend extraction, etc.

Finish the extraction of the backend, so backend is pluggable, all while resolving a number of bugs.