Replaced smiple open(file) with with open(file) to prevent not closed file pointers. Implemented reading of user config.