Physical mechanisms of in situ surface gettering of metals in ribbon silicon for solar cells