That is an excellent way to construct it as It would be very useful for some of us to be able to swap out the emoncms code for an emonhub alternative.
I am very interested in the development of wifi connected nodes with ota updating but where I want to use them I cannot connect them to the existing wifi and my monitoring equipment can only have one externally exposed device per site. So to be able to connect multiple emonTx to a single emonbase/emonhub configured as an wifi AP would work very well for me as it offers greater security (only one device connected to the WAN), multiple targets (html & mqtt) and will also offer buffering of data undelivered due to network issues or server maint’.
Not to mention it making the site a closed system that can continue to operate independently of an outside connection which is essential as we move into control. In time I would like each emonbase/emonhub to run a mqtt broker for all local activity and bridge to a main broker.
This single link between hub and main server paves the way for using either a single tunnel or gsm device if faced with networks behind proxies, tough firewalls.or just remote locations.
I know that many average users will have no interest in much of this but just by making the code modular and being aware of the possible options makes the project much more flexible and suitable for easy adaptation by those of us that want something different but do not want to have to totally rewrite or create more versions instead of building on whats there.