Optimize key-based Hash access for empty hashes

This avoids performing the potentially expensive hash computation in
the event that the Hash is empty, as there cannot possibly be a match.
Conform to MRI behaviour for empty hashes

In the event that the `#hash` method has side effects, any optimisation
with respect to empty hashes will affect the results of the operations.

For MRI, the empty-hash optimisation seems to be applied everywhere in
2.0.0 and beyond. In 1.9.3 the #hash method is not called for #[] and
#key?, but strangely enough the performance is not improved for empty
hashes. In 1.8.7, the #hash method is always called even if empty.

This does not match the semantics of MRI exactly, as this avoids calling
the #hash method from #values_at in 1.9.3, but that would be slightly
more involved to implement.
fixed issue 1695
String#rindex should handle matchdata strings

A string extracted from a matchdata object shares the same
byte array as the string it was matched against. When doing a
rindex between a string from a matchdata and the string the matchdata
was matched against the same byte array is passed into ByteList.memcmp
which will always return 0 as ByteList.memcmp just checks for equality
of the byte arrays.

I fix this by passing bytes() instead getUnsafeBytes() into the
ByteList.memcmp method so that the byte arrays are different.

Fixes #1688
fixed issue 1517
change test case
add test case
make the layout lazy on StructByReference to allow to use self.ptr inside the layout. possible fix for #1729

Conflicts:
	spec/ffi/managed_struct_spec.rb
[GH-1726] - File.read should raise an Errno::ENOENT when the file is an empty String.

File.read it's currently raising EncodingUtils.java:597:in `encAscget':
java.lang.ArrayIndexOutOfBoundsException: 0

But it should raise an Errno::ENOENT to keep the MRI compatibility.
Merge pull request #1703 from k77ch7/GH-1695

Fix for issue #1695
Make behavior of Array#eql? more closely match MRI
Fix typo
Merge pull request #1684 from k77ch7/GH-1517

Fix for issue #1517
Merge pull request #1714 from atambo/rindex_with_matchdata

String#rindex should handle matchdata strings
Merge pull request #1731 from lucasallan/gh-1726

[GH-1726] - File.read should raise an Errno::ENOENT when the file is an empty String
Trivial doc fixes
Change name since we changed it internally for profiler
Do not NPE if you try to use jruby/profiler and profiling is not enabled
generate gemspecs from gem and NOT use the ones installed by rubygems in specifications - fixes #1566
jruby-openssl is on master only