Refactor to use a promise for initialization (requires Firefox 29+)