jscam: An easier way to define factory templates.

refs ticket:4234
jscam: Implement auto-detection of enemy bases.

Group labels for enemy bases are no longer required
most of the time.

Fix base2factory in cam1b.js in the process.

refs ticket:4234