Binding toplevel `main` functions to onload event.