v4 update - Major refactoring and full use of namespaces.