Refactored state into separate file. Adding in functionality to list files.