Created an option to serialize graph. Closes #1.