Context manager

refactored harprofiler into a Context Manager class.
Would it make sense to do something like this to avoid some repetition?

```
if not cached:
    har_name = self.har_name
elif cached:
    har_name = self.cached_har_name

log.info('saving HAR file: {}'.format(har_name))
with open(os.path.join(self.har_dir, har_name), 'w' ) as f:
     json.dump(har, f, indent=2, ensure_ascii=False)
```