Added helper js scripts, moved javascript to external files.