Improved configuration flexbility

Replaced 127.0.0.1 with DOMAIN variable, and added REDIRECT_URI for flexible configuration.