MsgPack-RPC dispatch based on function array lookup #864

This simplifies the generated msgpack_rpc_dispatch() function, separates the
code for each RPC method more clearly and allows easy implementation of
alternative dispatching methods (e.g. string method id dispatch).
cmake: upgrade libuv 0.11.23 -> 0.11.26 #911

Fixes some bugs and increase the performance of uv_hrtime() on OSX, which
reduces its prominence in performance traces. This allows us to better see
what's really causing slowness.

ref:
- https://github.com/neovim/neovim/issues/868
- https://github.com/joyent/libuv/pull/1325
- https://github.com/joyent/libuv/releases
Add vim_feedkeys API function

- New API function to push data to the typeahead buffer - this should
  equivalent to the vimscript feedkeys() function
- In Vim there was a --remote-send command to insert input into a
  Vim server instance. Besides accepting key sequences it also
  translated special keys such as <CR> or <Leader>, backslash notation
  is ignored. This commit backports the original Vim handler for
  --remote-send as a bool option for vim_feedkeys()
- vim-patch:0
dispatch function generator: Fix bug in validation/initialization

- Initialize variables before validating argument count to remove possibility of
  freeing uninitialized pointers
- Set the error when the argument count validation fails
Merge pull request #916 'Add `feedkeys` API function'
Removed unnecessary PATHS from cmake modules

- DEPS_INSTALL_DIR is already set into CMAKE_PREFIX_PATH in
  the main CMakeLists.txt
Merge #910 'Remove unnecessary PATHS from cmake modules'
Import mingw-w64 cmake toolchain settings
Enable cross compiling of third-party dependencies

- Change third-party CMakeLists.txt to handle building
  with cross compiler
- Build libuv, msgpack and luajit with TARGET compiler
- Build a luarocks and luajit (for the interpreter) with
  the HOST compiler
Add support for the PDCurses curses library

- Public Domain Curses is a curses compatible library that runs
  on windows
Cross compile Neovim in Travis with Mingw-w64

- Travis now cross compiles Neovim using Mingw-w64
- The ubuntu 12.04 packages did not work for libuv, we are downloading
  a Mingw-w64 snapshot on every run
- All Neovim dependencies are also being compiled along with Neovim
Bundle PDCurses when cross compiling

- When cross compiling build a bundled PDCurses library
Picked: Refactor declaration generation

- Call compiler from CMake instead of lua script to generate a
  preprocessor file - allows for better/early error detection if
  the compiler fails
- Preprocessor files are saved along with the headers as .i files
- Accept preprocessor lines with trailing chars after # as is
  the case in Clang/Windows
- The fourth argument to gendeclarations.lua is now the path to
  the proprocessor output file
Picked: Add cmake platform checks

- Defined CMake checks for all headers in config.h.in
- Removed headers checks that are not used anymore:
  sgtty.h sys/statfs.h libintl.h poll.h
- Added UNIX check
- Add some fatal checks
  + Check for setenv() and fail if it does not exist
    since our os layer just assumes it does
  + lstat is required by os_unix.c
  + sys/wait.h is required in UNIX
- Removed entries for functions that are not being used: getcwd,
  getrlimit, getwd, nanosleep, sigaltstack, getwd, sigstack, fseeko
- Replaced nearly all defines in config.h.in for functions with
  compile time checks
- Add check for symbol FD_CLOEXEC
- HAVE_ICONV_H and HAVE_ICONV hold the expected checks but Neovim uses
  USE_ICONV define to actually decide whether to enable it
- Removed checks that are no longer needed
  + USEMEMMOVE
  + Removed checks for select.h and sys/select.h and includes
    in vim.h
  + _FILE_OFFSET_BITS
  + HAVE_ST_BLKSIZE

Conflicts:
	config/config.h.in
Fatal errors for setenv/lstat only for UNIX
Picked: Hinidu mkdtemp branch from #850
Define uid_t for windows
Add platform check for langinfo codeset
Mingw: Use POSIX compatible stdio

- There are some differences between stdio (*printf) functions in POSIX
  and the MS runtime, this commit enables Mingw compatibility for these
  functions