Refactor code into separate methods

@mikeybox – I've refactored the plugin into separate methods but that doesn't include your recent changes so I'm getting merge conflicts.

I've made a pull request if you fancy doing the merge? I imagine it's just the `self.get_project_settings()` that needs changing, but I think you're doing something with the file types filter that means that this wouldn't be enough…