Adding CORS support and some code cleanup

Adding ¨Access-Control-Allow-Origin: *¨ to stock reply and making sure its part of all replies.
Moving all the reply headers into one place