Refactored graph.js. Added some animation.