Fixing issues with semantic analysis of relative imports (#60).

* Cleaning up and adding relevant tests.