Generate 'import' directives before the 'part' directives.

Review URL: https://chromiumcodereview.appspot.com//12427006
fixes #391, allow @observable in part

Review URL: https://chromiumcodereview.appspot.com//12663003
Merge branch 'master' into link_work
Reworked URI computation and added test for URI fixup.