Return to previously focused element when modal is closed

We should investigate how we can return focus to the element that brought up a modal. Currently when opening and closing a modal the focus is reset to the top of the page instead of the element that triggered the modal.