Yilong tuffy port

This is a temporary pull request to review the changes.
It's also in develop. The problem is Yilong's development is based on an earlier version of deepdive. During the period, we made several changes (fixing unit tests, etc), which are not included in Yilong's branch. This one is the result of merginf from develop into Yilong's branch