Refactored Promise and Future based on JRuby weirdness.