Added test mode, supplying branch/tag regexp via environment variables