Add a function for safely inserting elements as well as a minimal modernizr