Added head logic, started to implement logic for classes and ids and stuff. Probably going to try to abstract out the head logic to something more robust.