Refactor browser related function scope; Fix an issue with 'none' transition not clearing animation state properly