Wave-function approach to Master equations for quantum transport and measurement