Insert teams before matches

This ensures all foreign key constraints are satisfied
Also started using an environment variable for config path