Dispose a console view.

 Close #833
(cherry picked from commit ef57e50)
Added package import test cases.