An automated magnetoencephalographic data cleaning algorithm