Nicely handle adding policies with missing title/description like PHP

Fixes #173
Only remove leading spaces from motion text

This was incorrectly removing newlines too which was resulting in
incorrect formatting.

This is a redo of a stuffed up commit f5058aad0c75a804ec399b2b784599dab7d4336e
that was reverted in 4352e5df833924341c5675e7032ceaf2910adb6a because
it included other unrelated stuff in it.