Bug 847060 - wip

just a work in progress for now, but creating a PR in case anyone wants to try it out