How do alarms work with Period Battery Optimization?
This is 'doze', a new power optimization feature introduced in Marshmallow.

Apps have to be compliant to doze specifications (APIs), to work continously across system low power states.,

While Google alarm app from stock android will work as it will be already doze compliant, any third party app (motorola apps or playstore apps) may or maynot have doze support, and hence might not function as normally..