Better mouse button handling.
Code cleanup.