Removed debug divs and started to actually structure the code since I've figured out the non-trivial parts.