Add onload behavior

Make the onload behavior from the rails gem available for the main library. This is useful for people who don't use gems to manage static assets.