First pass on making the backend extensible; still buggy