Performance Enhancements

Ported the similarity calculations to Lua and added an alternate method based on ZUNIONSTORE for calculating similarities. Made the method of performing calculations configurable.