Fix Ruby warnings (-w).
Mostly removed tons of dead code.