Updates to new-app-templates, move package definition to separate file, add app start, stop, restart functions, plus misc. corrections