Replace calls to deprecated APIs, remove some unused imports.
Merge pull request #120 from jotomo/codebase-diving

Replace calls to deprecated APIs, remove some unused imports.