wrapping up the globals

NOTE: THESE CODE CHANGES HAVE NOT BEEN TESTED

proceed with caution.
to-do:
  - test
  - create api variations with Model* pointer as first arg