Add modernizr, refactor helper methods