API: Cleanup: Remove unnecessary NULL checks
API: Bugfix: Check that error isn't set in buffer_get_line
API: Bugfix: Remove wrong increment statement from buffer_set_slice
API: Bugfix: Fix loop condition in vim_list_runtime_paths
API: Bugfix: Use 0-terminated string in vim_strwidth

While the mb_string2cells function accepts a length parameter, it only seems to
work properly with 0-terminated strings, since valgrind reports a conditional
jump that depends on uninitialized values(means it reads after the string
boundaries which could result in overflows or wrong results)
API: Bugfix: Terminate directory string in vim_change_directory

Also check that the string length is not equal or greater than MAXPATHL.
API: Refactor: Move non-public files to private subdirectory
API: Refactor: Implement api/handle module

This module will be used to implement remote management of objects through the
API. Object types to be registered must have a `uint64_t` field named 'handle'.
API: Refactor: Register/unregister created/destroyed buffers

- Add the 'handle' field to `buf_T`
- Add declare/implement functions for registering/unregistering/retrieving
  buffers
- Register/unregister buffers when they are created/destroyed.
API: Refactor: Register/unregister created/destroyed windows

- Add the 'handle' field to `win_T`
- Add declare/implement functions for registering/unregistering/retrieving
  windows
- Register/unregister windows when they are created/destroyed.
API: Refactor: Register/unregister created/destroyed tabpages

- Add the 'handle' field to `tabpage_T`
- Add declare/implement functions for registering/unregistering/retrieving
  tabpages
- Register/unregister tabpages when they are created/destroyed.
API: Refactor: Generalize buffer, window and tabpage types/functions

- Extract remote types definitions into a macro
- Extract msgpack_rpc helper functions for remote types into a macro
API: Refactor: Add macro infrastructure for typed arrays

- Add macros supporting typed arrays in the remote API
- Refactor StringArray-related functions on top of the new macros
API: Refactor: Change the integer type of remote objects to uint64_t
API: Refactor: Return handles instead of indexes

- Define specialized arrays for each remote object type
- Implement msgpack_rpc functions for dealing with the new types
- Refactor all functions dealing with buffers, windows and tabpages to
  return/accept handles instead of list indexes.
API: Refactor: Implement buffer_get_number
API: Refactor: Use macro for initializing all arrays
API: Refactor: Fix buffer_get_mark
API: Test: Setup basic test infrastructure

- Add a 'expect' utility script that can run simple API tests using clients
  developed for any platform.
- Extend travis build matrix to run API tests using the python client and
  valgrind.

This script can be used to write API tests without having to manage nvim's
lifetime:

- It starts a single nvim instance listening on a known socket
- Invokes the test runner, which should connect to NEOVIM_LISTEN_ADDRESS
- The nvim instance started by the script provides a `BeforeEachTest` function,
  which should be called before each test to reset nvim to a clean state.
- It takes care of shutting down nvim once the tests are finished.

As explained
[here](https://github.com/neovim/neovim/pull/737#issuecomment-43941520), it's
not possible to fully reset nvim to it's initial state, but the `BeforeEachTest`
function should be enough for most test cases. Tests requiring a fully clean
nvim instance should take care of starting/stopping nvim.
Merge branch 'use-uids-for-api-remote-objects'