It should be safe to take them away at 4 weeks of age. They should be fully weened by then and they can start to re-produce right around then too!

Has she eaten any lately? Usually if they live past the first few days or so they are safe. If she is still eating them then I'd be worried.
They are known to eat the babies for a number of reasons. The babies may have possibly had some sort of problem & the mother ate them because she didn't think they would survive, or if she had a huge litter she may eat the runts as she is afraid she won't be able to feed them properly. If there are other hamsters around she may eat them out of fear or stress. If you bother her too soon after the babies are born she may eat them out of stress as well.