No longer try to use standalone termcap
printer_opts was left unitilized after #378
Revamp the build system.

This achieves several goals:

 * Less reliance on scripts so we have better portability to Windows
   (though we still have a ways to go for proper Windows support).
   Luajit, luarocks, moonscript, and busted are all installed via CMake
   now.
 * Trying to make use of pkg-config to get the correct libraries.  The
   latest libuv is still broken in this regard, but we'll at least be in
   a position to use it.
 * Allow the use of Ninja or make.  The former runs faster in many
   environments, and automatically makes use of parallel builds.

This also allows for system installed dependencies--though not through
the Makefile just yet--and adds support for FreeBSD.

This also make us build libuv and luajit as static libraries only, since
we're only concerned about having static libraries for our bundled
dependencies.
Deal with the missing dependencies for libuv.

Since libuv.pc is broken at the moment, try to determine libuv's
dependencies ourselves.  This ports most of the checks from libuv into
our CMake build, and fixes the build on other unix platforms.
Workaround the broken progress feedback in some versions of CMake.

Underneath the hood, CMake uses libcurl and libcurl has had a number of
issues regarding progress feedback.  In one sample run against Travis
CI, we ended up with nearly 3,000 lines of progress output for a single
download.

Unfortunately, CMake doesn't have the download and extract steps
separate, so we have some extra work that we have to do.  Much of the
content was taken from the ExternalProject.cmake and it's template for
generating the content of the download and extract CMake files.
Update to the newest libuv version
Migrate input/signal/sleep code to libuv

Reimplement user input, signals handling and sleep on top of libuv.

The event loop runs in a background thread, started very early by 'io_start'.
Mutexes/condition variables were used to emulate the current blocking interface
needed by the rest of the code.

Here's a list of changes performed:

- A new function `io_read`, replaces the `read` system call interface when
  reading from stdin(or stderr when stdin is a pipe).
- Reimplement `mch_inchar`, `mch_delay` and `mch_char_avail` using libuv
  objects.
- Move `mch_exit`, `mch_breakcheck` `mch_inchar`, `mch_delay` and `mch_char_avail`
  to modules under the 'os' directory.
- Signals are now intercepted by libuv and delivered synchronously to the main
  thread as 'special keys'(Similarly to how the `CursorHold` event is implemented).
  The actual code for handling signals was moved to signal.c.
- Remove unused functions in os_unix.c
- Travis will run an extra parallel build with the thread sanitizer enabled.
- Add option to generate static executable(for debugging core dumps sent by
  users)
Try fix
Try to be more consistent
Fix return value
Refactor `io_poll`
Fix SIGABRT when stdin is a regular file
Fix TTY check
Refactor libuv calls to reflect latest API changes