Fix compiler error for Scala 2.10.x, and convert Promise and CancallablePromise to traits.