Implement generic extension mechanism, removing dependency on Bookaml