Infer importpath if not set explicitly (#3705)

* Infer importpath if not set explicitely

* Add test with explicit and implicit importpath

---------

Co-authored-by: Zhongpeng Lin <zplin@uber.com>
7 files changed