Modularized

I moved the main() type logic into an 

```python
if __name__=="__main__": 
```

call so that pasteminer can be used as a module by other programs.