Refactored some code, now allows initialisation from the constructor class and also allows passing of id/classname or htmlelementlist to constructor/init function