Add support for tags

This adds support for tags in NIPAP as described in #190.

The database is updated with two new columns; tags and inherited_tags,
both of which are of the type text[]. inherited_tags is a list of all
tags that the parent prefixes of a prefix has.

For example, 1.0.0.0/8 has the tag 'foo'. 1.3.0.0/16 has the tag 'bar'
and will have 'foo' in its inherited_tags. 1.3.3.0/24 doesn't have a
direct tag but will have both 'foo' and 'bar' in its inherited_tags.
The population of inherited_tags is handled by a new database stored
procedure called calc_tags() and is run by a trigger on the ip_net_plan
table.

The backend has a new function to list tags, but as the tags are so
simple at this point, we don't offer any other functionality. Ie, it is
not possible to add or delete a tag - it is performed implicitly by
adding or removing it to a prefix. The search_tag() function by the
backend can be used by the web UI/CLI for (tab-)completion of tags.

Functions returning list of prefixes have been updated to include the
tags and inherited_tags columns while the search_prefix and
smart_search_prefix have been further modified to handle tags.
smart_search_prefix will interpret anything that starts with a hash '#'
as a tag and will match against the tags or inherited_tags column. A
search for '#foo' will thus return all prefixes which either directly
have the tag 'foo' or if they have it indirectly through the inheritance
of it from a parent.

Neither the web UI nor the CLI will list the tags associated with a
prefix but instead only display a small icon (in the web UI) or the
number of tags (in the CLI). A mouse-over tooltip lists the tags on a
prefix in the web UI while a more advanced tag widget is used to edit
the tags on a prefix.

A new test suite case has been added related to tags. The new test case
is specifically focused on tag inheritance.

Tags are represented by a new class in Pynipap and while this is not
necessary for the time being, I foresee that we will add more attributes
to each tag at which point it is convenient to just add them to the Tag
class. Backwards compatibility hopefully won't be an issue.

Part of #190.
Add upgrade file to package
Update build status image to master branch

The build status image showed failed when the latest build, regardless
which branch, failed. Since we only want to keep track of master..
Let Travis build deb from source

Let Travis build deb packages from source and install those instead of
pulling debs from the official NIPAP repo. This tests that the package
building works as well as the installation scripts!

Modification done to the database will also be included in the setup
instead of the potentially old database structure that the stable NIPAP
build ships with.
Remove .diff.gz files on make clean
Add VLAN attribute to prefixes

This adds a new column in the database (simply called 'vlan') and
exposes the value of that column over XML-RPC. Pynipap, the CLI and the
web UI have been updated to display the new attribute and allow editing
of it.

There are currently no constraints other than that the value must be an
integer.

Fixes #393
Sort tags in alphabetical order

Tags are now sorted in case-insensitive alphabetical order, both in the
CLI as well as in the web UI.

Part of #190
Merge branch '393-add-vlan'
Merge branch '190-add-labels'

Conflicts:
	nipap-cli/nipap_cli/nipap_cli.py
	nipap-www/nipapwww/controllers/xhr.py
	nipap-www/nipapwww/templates/prefix_edit.html
	nipap/nipap/backend.py
	nipap/sql/ip_net.plsql
	pynipap/pynipap.py
	tests/test_cli.py
	tests/xmlrpc.py
Cleanup after conflict

Missed two conflicts.. am I blind? :/
Handle empty VLAN as None/NULL

Part of #393
Fix mistakes from implementation of 190 and 393

I completely missed adding VLAN and Tags to the prefix add form, as that
is a separated form from prefix edit. That has now been fixed and it's
possible to specify VLAN and tags when adding a prefix.

There was also a bug in where an empty VLAN string ('') would not be
accepted as the database only accepts integers for the VLAN column, not
an empty string. This has been fixed, both for editing and adding a
prefix.

We should try to merge the two forms to make subsequent additions of new
attributes easier.

This fixes #190 and #393.
Node field now enabled for host prefixes

Fixed a bug which caused the Node field in the edit prefix page of the
web UI to be disabled for host prefixes. As a consequence of the fix,
a radio button displaying the prefix type 'host' is now again visible on
the edit prefix page.

Fixes #399
Update postinst

Make www_user a trusted user (recommended according to NIPAP documentation)
Merge pull request #406 from dosomder/patch-1

Update postinst to make www_user a trusted user
Fixed bug in remove_prefix and pool edit ctrller

Now the correct key is accessed when adding entrys to the audit log
regarding affected pools.

Added c.prefix to the edit_pool controller, as it's accessed in the
prefix_add_container-template.
Include the indent level in result from backend

Part of #340.
Add indent as filter for XHR search

The XHR version of smart_search now allows filtering based on indent
level.

Part of #340.
List top level prefixes on empty search

When performing an "empty search", ie with a zero-length search string,
only list the top level prefixes (indent = 0). An empty search is
probably a sign of that the user wants to see everything and showing
only top level prefixes is probably a better starting point to give an
overview than directly listing and expanding all prefixes.

Fixes #340.
Merge branch '340-list-top-level'