fix destructor crash on bad weak pointer, oups.
add a function to get a static cast shared pointer
set default alignment
pass control to handler, lambda may not be able to capture it

While I don't know why, a lambda handler for a control event cannot seem to capture the control, so it needs to be passed in.
reflow header content to be more concise
move function to implementation