keep deferreds alive while their pipes are pending

also added tests for convenience methods
convenience macro for declaring weak copies of variables