Refactor to allow requestPermission to be called directly. Closes #5