Added state-handle and some support for asynchronous activities.