Continue complete refactor, cleanup, code documentation and unittest coverage