LookupTable fixes and optimizations

This PR fixes #98 and optimizes a couple of other things. Also fixed a bug where self._indices was also being cast in :type(type) (yet it should always be LongTensor).