Implemented listeners, removed embedded html logic, now can be used with another canvas