added scriptdir to import path, fixed call to os.environ.has_key

Change-Id: Id0a26aec8167627eab58bc2c413b1ca520329593