Refactored, better matching (faster, less bugs), unit tests, better line matching