The start of a bigger refactoring to support Composition and AD -- still broken across the board, sorry!