Better checks against blacklisted modules, catch __import__

Change-Id: Ia63b71962d8d472f241c02806df0f44fd25fc85c