EdgeBasedGraphFactory refactoring

Refactor EdgeBasedGraphFactory and C++11ify Contractor/.

Also I added some timing macros and applied them in EBGF.