Speeded up startup time for Local Executor and Tests

Involves the following:
  - Faster registration of TM at JM
  - Optional lazy memory allocation in TM (used in local and test mode)
  - Some cleanup in TM startup