ca-cas: Test for file existence before overwriting

This avoid needless fragmentation, since the file we're removing is the most
recently created.  This approach is also faster if we're loading many
duplicates.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
Added the ca-cas-repack program

This program grabs entities stored in individual files and collects them into a
big file with a leading hash table for quick lookup.  After the pack file has
been created, the constituent files are removed to save space.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-cas: Print 200 status message when entity found in pack file

Prior to this commit, you would only get the 200 status message if the entity
was found as a separate file.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-case: Create directories with 0777 mode

Let the user decide whether subdirectories should be accessible to others.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
ca-cas: If no path is given, assume current directory

This makes the program slightly more convient to use if the current working
directory is the storage directory.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>