Mostly refactoring, added the token class

Also modified factory class to build objects that don't take parameters
to their initializers. Removed currently unused methods.
Changed from @@ variables to class variables.