Ensured that detach/attach works.

Removed custom implementation of , and added a  method that is rigged to the close-button.