Wavefront shaping assisted design of spectral splitters and solar concentrators