Added id to Pipeline and template_id to Apps.

Refactored AutoBeans to extend HasName where appropriate.
PipelineApps need to keep track of their template_id separately now that existing Pipelines may be edited, so their existing IDs also need to be preserved.