Fix metadataonly parameter and use it in JS
Without declaring it as boolean, getParameter would not return a
We don't really need to detect if it's omitted. Omitted and
explicitly false will both cause a backwards-compatibility problem,
so use an appropriate message that covers both.
Use this in JS so we get the benefits before removing it.