Fixed performance issues by using the beginPath() method so that dashed lines do not accumulate on the default path (thanks @gfcarvalho). Also extended the canvas object to include the dashedLine function as this seems to go more naturally here. [fixes #7]