Relaxed jshint for use of document.write
Changed drawChart to draw in $chart service, added test for $chart.draw method