cleaned up code to be more intelligent/readable.  Should probably be faster too
updated click handler to only show classes if all it's prereqs are expanded (though still a little buggy)