Adding "imports" and "global_scope" insertion points for plugins, fix compiler warnings

Contains two commits:
- New feature
- Fixes for warnings