Adjusted code to properly Await and Async

it seems the media capture class is sensitive about trying to attach to
it before it has initialized fully.  Adding await to onload to the
initialize seems to have fixed this.