Major rebase to bring master up to speed with 0.9.x

This is a local trial.