Basic implementation of new/resolve/reject/then