change all global vars to handlers

screw this whole scoped vars thing. I'm just making them all handlers. Done.