Heegaard Floer theory for 3-manifolds, tangles and cobordisms between them