make Aalloc an op by reworking do_app

do_app is now split into do_opapp and do_app. The former returns a new
environment and expression whereas the latter returns a result. Both
become simplified by this division.