We're using python3 so let's get rid of encoding
Python 3 uses new style classes as default.
Converted to a oneliner
Use a context manager instead
Reworked imports
Refactored applicationinstance.py

- Use a property for pid. If ApplicationInstance.pid is accessed
  the pid file is to be read.
- Chose proper method names.
- Use context managers instead of file = open() hacks.
Merge pull request #1 from rumpelsepp/cleanup

Code cleanup