Density function for a directed graph by default.

Extended the function to give density for a directed graph (since the library usually creates directed graphs. If specifically needed the a true value can be passed to the function which will return the value for an undirected graph.
stupid mistake

corrected the stupid mistake.
Fixed for existing clients and commented in jsdoc format
Merge pull request #68 from sbmkvp/patch-1

Density function for a directed graph by default.