Refactoring for HashedWheelTimer with tests

Ported commits from Akka:

* https://github.com/akka/akka/commit/cb4e3536b0ed3483bd3636d7789c0ddcadafa2da
* https://github.com/akka/akka/commit/7e590f3071bdf89a4aa9d7d262bac8923d85e754
* And also https://github.com/akka/akka/pull/1027