Split js code so that we can now provide some theming

Add a configuration file, to handle all the command line parsing and configuration
Try to split code properly. Maybe this is not how we do it.