Lighter structure.

Functions were moved out from the core. The two thematic functions
files: theme.php and security.php are now part of plugins. As plugins
these may be removed or changed by any other that better suits any
specific needs without affecting the core library.

Also the whole directory lib/3rdp was removed. All the stuff that used
to be here was not part of the core but 3rd party's stuff so it made
sense to make all that plug-ins.