octascript: implement code generation for the import statement

Also use it in a few places.