Bug 1069214 - a work in progress but most things now work.