Improved environment handling and updated gitignore