Mostly this is code copied from bm_fullstack and rephrased as a test. I'm resisting the urge to unify it however, as I expect this code will evolve differently over time.