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.
Add a few scripts.
Add some semi-generic build and update scripts.
Rename hook scripts and mark them as executable by the owner.
Fix the function which looks up the latest OS version.
I have to delete files after a rename?
Wrong variable.
Add support for using a custom build script for jails of type USER.