refactoring, integration with xctool, various improvements

- optimized performance by not constructing the whole json compilation database in memory
- added support for logs coming from xctool's json-reporter
- refactored code using a tokenizer (shlex for -rare- complicated cases, a simple 'split' otherwise)
- made ObjectiveC implicit headers explicit
- made .pth recovery work also for .h source files
- moved top-level into main() for better style