Add resource labels template. Add envelopes.
Fine tune js events.