Refactor to introduce Graph struct

Also add cmd folder for command line interface