Refactoring sample to use type registrations
Renaming Registry to Funk.
Extracting out some responsibilities so that the pieces are easier to deal with.
Updating samples and making function names consistent.