Optimizations to the custom GB models

This is a first pass at optimizing them.  @jlmaccal could you try rerunning your benchmarks with this and see how they've changed?