Replace browser detection with helper methods

Fixes #260 as discussed