Moved implementation of DomainGraph class to graphs.py file.