cleanup and add clipboard support, fix #63