Methods for the wafer-scale encapsulation of MEMS