inital move to rebar compilation

- move src/apps
- download dependencies using rebar
- replace ejson by jiffy
- replace couch_drv & couch_ejson_compare by couch_collate
working build of couchjs

couchjs is now built correctly. It can be build against the libraries
already installed on the system or statically.

By default it set the CFLAGS to /usr/include/js and the LIBS to -lmozjs185.

These values can be changed by setting the environnment variables
JS_CFLAGS and JS_LIBS.
make the couch_replicator a full Erlang application
couch_drv has been replaced by couch_collate
add release build
working release
fix version number

display the release number when available instead of the couch
application version.
remove Makefile.am from apps/ and fix couchspawnkillable
fix build on macosx
Revert "fix build on macosx"

This reverts commit 94fe661233f69faa8cfbcb71d0202eb9bca4600f.
move sources to src
support static build

This change backport the static build from rcouch.

A static build of spidermonkey is the default. To build with the
libraries installed you can pass the parameter `libs=shared` to the
make.

By default couch_collate is using ICU installed on the system except if
you pass the option `icu=static` to the Make.

At anytime you can override the compilation environnement with the
following variables:

JS_CFLAGS
JS_LIBS
ICU_CFLAGS
ICU_LDFLAGS
add `make test` target . all erlang test pass

note: from time to time there is a timing issue on 200- test that need
to be fixed. It is most probably due to the way the indexer is
supervised.
fix tests
couch_index_sup should be started by the couch application

I had this patch landing in a custommer repository for awhile. Since
couch_index is always dependent of couch it's better to add it to the
couch application supervision rather than on its own.
add javascript test and make check target

now it's possible to run javascript tests from the console:

    make testjs

While I was here I added the make check target to launch all tests.
make couch_httpd a full couch application

With this change, the HTTP API is now handled by its own erlang
application and supervision. It also improved the way you can reload the
configuration and the modules. Now upgrading a listener or its
configuration is first removing it from the supervsion then start the
new process with the new configuration. This behaviour is similar to the
one you have in nginx.
move src/* to the root

There is no need of an src/ folder except for an aesthetic reason, we
are obviously distributing a source. This layout is alos more common in
the Erlang world, and most editor and package manager understand it.
couch_server_sup -> couch_sup
Speed up and move couch_httpd:find_in_binary.

See https://issues.apache.org/jira/browse/COUCHDB-1953