Implement simple promises framework to make callbacks more readable.