log: supports printing stack trace on error logging
main: supports --stack, prints stack trace upon error logging
Preparations for multi-master graphs
Some minor cleanups