Can we put the rest of this code below in a builder JS file?

Also, it should stlll work if there's no app id specified. Just a webmap should be sufficient.