Move the graph window related code into graph directory

Simplify the code a little by creating graph directory