Design of hierarchically structured BiOBr-based photocatalysts and photoelectrodes for enhanced solar energy conversion