Selenate and sulfate removal in UASB and BTF bioreactors