Logging Interface and Main Function

Reworked logging interface and wrapped main code execution in main
block.