Add emptyView support.

Cleanup unused variables.
extract 'add emptyView' logic into helper and prevent unnecessary add/remove emptyView work
Merge pull request #108 from jmonma/master

Add emptyView support.