Radical changes to syntax.

Moved the code to classes.