A simple promise implementation