Norms of Toeplitz and Hankel operators on Hardy type subspaces of rearrangement-invariant spaces