Don't allow creating programs with undefined type

* Also, no need to init empty arrays, mongoose will do that for you.