Add support for accessing static members (fixes #46)

This allows access to static members and provides unit tests for a different access methods.

Cleaned up from my previous PR.