add makehttps function to switch url to https, mostly for sitematrix but usable elsewhere
start some code tidying, use config variable for oauth server
update sample config
code tidying