Import from libucl

Adapt to new API
Remove ustring.h from external
Emit the manifest on the right object
Clarify message about empty catalogs
Free the parser only when needed
Fix json emission
Remove debug
Do no accept unknown user/group in pkg register -i
Simplify parsing with numeric values of for version or name
Add a new pkgdb_close_rw hook
Allow pkg_register_cmd_argv0 to be executed according to argv[0]

Known issues (this only works with 2 arguments and still get the pkg(8)
first arguments)

While here allow pkg_register_cmd to register multiple commands.
Remove debug and properly execute the plugin
pkg_register_cmd_argv0 makes no sense directly creating a binary using libpkg is a better solution
Sync libucl
Print architecture of a package in info output.

Package architecture seems to be an important property for an end user
since there are no other possibilities, such as file naming, to detect
architecture of a package. Therefore, print the architecture in pkg info
output.

Reported by: Eugene Grosbein via irc
Do not build twice pkg object to get pkg-static
Handle proper rebuild depending on dependant .a

libpkg.a is now rebuilt if sqlite, yaml, ucl are rebuilt
pkg-static is now rebuilt if libpkg.a is rebuilt
Simplify dependency generation
Only try to open remote repositories if some are actually configured
Include manifest length to the digest file.

To speed up parsing we need to know the exact length of manifest pushed
into packagesite bulk. Therefore, this patch modifies the digest file
format from:

<origin>:<digest>:<manifest_offset>:<file_offset>

to:

<origin>:<digest>:<manifest_offset>:<file_offset>:<manifest_length>

This does not break compatibility with the older versions of pkg and
improve the packagesite parsing speed.