Fixed a while bunch of stuff, cleaned up bugs, made sure it all works. Need to implement caching next, should be easy :-o