Put all code in a object, added check for local file or http/www file, added processmessage Message widget function, updated comments and print messages, also load before/when handling write