Switch to use PostgreSQL instead of SQLite.

We're now going to target only PostgreSQL instead of SQLite. This commit
updates all (most) settings and tests to depend on PostgreSQL.
Handling race condition problem in post number generation.

Since subquery SELECT inside INSERT will cause race condition when two
transactions starting at the same time. We should just retry it in such
case, since our UNIQUE CONSTRAINT will cause the query to fail with
IntegrityError.
Slight cleanup, add docs.
Merge branch 'feature/postgresql-only' into develop
Add scoped topic for posts querying.

This scoped topic will be used for selective post querying, for example
a query URL of 5-10 will return post numbered 5 to 10, or recent will
return last 30 posts, and such.
Styling for site header, make it no longer fixed at the top.
Styling for board and topic header, add partials for shared CSS.
Stylings for topic listing page, initial Retina support.

* Replace all broken border-radius: none; with border-radius: 0;
* Update license text, add license for icon file.
* Add icons to all links.
Update topic listing design to make it easier to eye.

Previous design has too many colors it's distracting. Current one, while
not very pretty, it's much easier to scan through the page.
Add base template for post listing with some initial stylings.

* Drop some unnecessary <div class="well"> elements.
* Flat styling for buttons.
Add initial form styling for add new topic page.
Stylings for reply thread, some cleanup.

* Better style for board posting agreements.
* Change wording when there's no topics.
* Move form stylings into form partial.
* Move font size definition for post body to shared.
Some legwork for adding Jinja2 filter for text format.
Convert app to Python 3.3, make all tests passed.

* Remove pyramid_zcml usage since it's not compatible with Py3.
* Replace ipaddr with built-in ipaddress (which has the same API).
* Replace all u"string" usage to just "string".
* Change from assertItemsEqual (now deprecated) to assertEqual.
* Replace iteritems() with iter().

Some bugs are also fixed:
* Use TEXT instead of BINARY for storing JSON (JSON is text isn't it?)
* Replace Unicode in Post.body with Text since Unicode is VARCHAR.
Add missing tests in model for posts ordering.

Also change to use set literal {} instead of set().
Remove few unused args and super.
Run project through 2to3.
Merge branch 'feature/py3' into develop
Add helper functions for datetime handling.

Also make datetime field timezone-aware since we're doing TZ conversion
on display (defaults to Bangkok with UTC as datetime attribute.)
Move context retrieval code to traversal resource.

This fixes board of scoped topic view incorrectly points to topic and
make views a little bit less aware of how traversal tree is structured.