builder: small refactor of the list output

Switch from a boolean for the short/long list output to labels for the
actual format. Also, split the output of each list format to an own
function for easier maintaineance.
builder: add --list-format

Add a --list-format which allows to choose which in format should be the
output of --list.
builder: add a JSON output for --list

Simple JSON output for sources and templates, to be able to query them
with no need to parse unstructured outputs like the "--list-format long"
one.