Make gendeclarations.lua more friendly to incremental builds

Modify gendeclarations.lua to check if the generated non-static declaration
header changed before rewriting it with a new version. This is to prevent
unnecessary rebuilds of modules that depend on modules that had private changes.
Merge branch 'make-gendeclarations-friendly-to-incremental-builds'
API: Refactor: Rename find_{buffer,window,tabpage}

They were renamed to find_{buffer,window,tabpage}_by_handle to avoid conflicts
with existing functions of the same name.
API: Refactor: Change type of event data to `Object` from `typval_T`
API: Refactor: Enable usage of Arrays and Dictionaries as [k]vectors

- Rename a/n/m to items/size/capactity in kvec.h
- Add capactity field to Arrays/Dictionaries
API: Refactor: Add helper macros for dealing with API type casts
API: Events: Implement the 'redraw:tabs' event
API: Events: Implement the 'redraw:insert_line' event
API: Events: Implement the 'redraw:delete_line' event
API: Events: Implement the 'redraw:update_line' event
API: Events: Implement the 'redraw:status_line' event
API: Events: Implement the 'redraw:ruler' event
API: Events: Implement the 'redraw:layout' event