Simple promise implementation for easier async programming