Fix related_type and related_id requirement.

If you specify related_type you need to specify related_id and vice-versa.

Without this change the handler gives a somewhat cryptic error message back.
Fix certificate uploading.

This was still using parent improperly.

While here, make it so if related_id or related_md5 is set you must also
set related_type and vice versa. And if the related object can not be
found complain early.

This ensure that if relationships are specificed but can not be made we
will refuse to add the certificate.
Fix pcap upload handler.

This is an identical commit to b6f073a930242cbb7ab216a49175fac2b67e9eed.

Make it so if related_id or related_md5 is set you must also
set related_type and vice versa. And if the related object can not be
found complain early.

This ensure that if relationships are specificed but can not be made we
will refuse to add the PCAP.

Also, fix a copy/paste error in a docstring.
Make class_from_id() behave better.

While playing with the API I discovered that class_from_id() would
raise an exception if the ID is not a valid object ID format (whatever
that is). I was testing and gave it an ID of 'foo', which raised a
ValidationError exception. To fix this I've made class_from_id catch that
exception and return None instead.

I also walked all the places where class_from_id() is used in core
and made sure they properly error out when class_from_id() returns None.
Make class_from_value() behave better.

This is similar to 4e4d2080c64b377164f3e1682b43a2991c5da707, except for
being on class_from_value() instead of class_from_id().

I also fixed handle_unzip_file() to be explicit about the return value.
This makes it consistent with handle_unrar_file().
Merge branch 'master' into class_mapper_fixes
Merge pull request #213 from crits/class_mapper_fixes

Class mapper fixes
Merge branch 'master' into distributed_services