A framework for building electricity market models