Clean up unused / duplicate imports, etc.

- Removed unused / duplicate imports and variables.
- Renamed parameter name 'type', which is a reserved built-in name,
  to appropriate names.
Merge pull request #148 from midokura/dev/tomohiko/minor-cleanups/20140424

Clean up unused / duplicate imports, etc.