Changed interface for types and updated internals
Updates constants.

Fixes scope in query

Need to finish version query