Added handling of bt functions in models
Modified the internal structure with which functions were stored in a model
Added support for foreign key overrides in model functions for bt, hm, ho