lua: implemented generic Device:init method (prepare for adding new classes)