Reorganized common namepsace

Moved functions into new outer namespace
Moved main into application module