Hashing API

Here is the Hashing API I have written as part of my GSoC project. Also added a  check of policy files for JCE in JCELoader. 
There are quite a few places in the code base that use offsets and lengths currently.