Add len function to macro rules.
Update documentation for metadata len function.
Correct metadata len() function syntax.
Re-tidied.
rose edit: fix error menu.

This fixes errors in variable widget menu construction when
there is an error for that variable created by a custom macro.

The problem was caused by a '/' in the custom macro name, which
interfered with the err_item lookup.
Merge pull request #817 from benfitzpatrick/rose-edit.fix-error-menu

rose edit: fix error menu.
rose suite-clean: fix lingering DB connection

It looks like `rose suite-clean $NAME` was leaving behind an empty
directory `$HOME/cylc-run/$NAME`. It turns out to be caused by a
lingering connection to the suite DB opened by the command itself, so it
was unable to remove the seemingly empty directory, because the suite DB
is renamed as a `.nfs*` file, which only gets removed when the command
is done. This change fixes the problem.
Merge pull request #818 from matthewrmshin/fix-rose-suite-clean

rose suite-clean: fix lingering DB connection
Added test for len(X) to test-battery.
Update metadata appendix to include len().
Merge pull request #815 from arjclark/rose-metadata-len-func

rose metadata: len function for fail-if, warn-if, etc
Merge remote branch 'upstream/master' into rose-macro-args