[backend/socketapi] flush trace file on every write
[tests] some test fixes
[backend/validate] new validation infrastructure

The module bluepass.validate implements a DSL for the validation of nested data
structures. It is similar to our orignal json.unpack() but more expressive.
[frontends/qt] use new JSON-RPC error codes
[backend/crypto] simplify crypto API and remove unused bits
[backend/factory] simplify and add tests
[frontends/qt] use get_logger()
[frontends/qt] fix uninitialized variable
[backend] refactor error handling and control api

Error handling has been much simplified. The class StructuredError is
gone now, and each API is responsible itself for translating exceptions
into API specific error messages.

The control api has been refactored. It now has a more descriptive name
(previously: "socketapi"). Also the base JsonRpcHandler has been moved
to a separate file and cleaned up. It has bene made to use the new error
handling.
[backend/platform] re-organize module

The "platform" directory becomes flat. Also remove a few unneeded
functions:

* get_machine_info() -> is provided by pyuv.util
* socketpair() -> provided by gruvi (Windows)
* secrets.py: was not used for a long time
* keyring.py: not used anymore
* crypto.py: remove hdkf() which is unused
[backend] disable ptrace() and support for mlockall()

There's a new CFFI module "platform_ffi" that exposes prctl() and
mlockall() on Linux. Other platforms that have these functions can be
trivially enabled. This CFFI module replaces the old "secmem" C module.

ptrace() is disabled when --debug is not provided, while mlockall()
needs to be specifically enabled with --lock-memory.
[setup] remove obsolete copy_assets() function.
[backend/clientapi] add a new API: the "client api"

The client API is HTTP/RESTful API that exposes a subset of the control API.
It is intended to be used by browser plugins.
[tests] re-organize tests
[tests] refactor and add new "unit" driver
[backend/platform] refactor platform sub-package
[backend/store] refactor the database and call it "store"
[tests] add support for performance tests
[skiplist] new container type: SkipList

A SkipList is an sorted collection of (key, value) pairs. It supports
efficient search by key, insertion and removal anywhere in the list, forward
and reverse iteration, and is indexable.

This will be used in the model to support partial retrieval of the version
list, and will also replace the SortedList in the Qt frontend.
Clean up model and use new upstream Gruvi.