Refactor

Cleaned up global namespace,
added message line types.