A general framework for modelling limit order book dynamics