Cleaned up d3 code, added tooltip