Added better documentation
removed more old variable cruft
reintroduced js loading