added sleeps in mouse wheel unit test
added tilde expansion to pid file location handling