Optimizations (memory, performance, usability)

Misc. optimizations:
- memory usage
- drawing performance
- dock activation/deactivation usability