closeAlertDialog will now error if a reason is passed. Added timeout param to alertDialog. Resolves #522.