Spintronics with two-dimensional materials and van der Waals heterostructures