fix bug in CascadingLocal tests causing the buffer to not be flushed

Issue #30
simplify RestClient#index (and fix a bug in the process)
update build file
merge upstream/master 1eb0d37,98c2a07 and 957424b commits