Add mobile device check. Manage persistent flags. Add error constants.