Fix #111 (clear block erroring out)

This was due to a missing extern for JSNetworkX.
Add conversion between digraphs and graphs

Closes #100.