go back to using onload, etc handlers

it is cleaner to read, and is supported in all
browsers for which this library is relavant