Add tmpfs support for the Build directory backing.

Submitted by:	swills
Only set PREFIX if it isn't already /usr/local.
Fix prerequisite checks for pkgng. The origin query of pkg-info(8) is
compatible with the one from pkg_info(1).

Tested by:	decke, swills
Approved by:	marcus
Fix the upgrade logic to not treat 3.X as a major upgrade when it comes to
the DB.  Also, since we no longer support 2.X, change all backup operations
to use a DB dump rather than a map.

Reported by:	swills
Sync with the latest doc revisions.
Update to 4.0.0.