Merge master and russell/bttf into bttf-beta

WIP still needs testing but this includes the latest changes in master and @russellholt's changes.