Factored out javascript settings

Made JavaScript sources based on resources, and added jsSources to
resources.