fixed indentation, downcased some names, fixed file handlers

I've fixed some bugs (e.g. with file handler) and made code a little bit more Pythonic, downcasing some names and renaming extension to short `pwa` (LongNamesWithCamelCase have no respect in Python 3).