Refactored some js into new .js file
Revert "Refactored some js into new .js file"

This reverts commit 726b3c93259e488e3235eebcbc2704f240f414f3.
Refactored some js into .js file and added

generate button and an implementation for the first tab generation.