reformat the code and check if the ring prjs to clean is all green

Without green state it's very dangerous to remove things not needed
*at that moment*
seperate the functions needed for the cleanup_rings command
Merge pull request #18 from coolo/fix_1351

Just preparations