Turned on type system and added support for search-based plugins.

Also fixed a bunch of bugs.

BUG=
R=scudette@gmail.com

Review URL: https://codereview.appspot.com/175080043