Moved some functionality to duggasys.js

Created a file named duggasys.js (temporary name) and moved some
DuggaSys related content to that file