Use FXA internal api; add tests (wip)