console: Migrate code

Migrate code from header file to cpp-files and
"_code.h"-files.
console: Codestyle improvements

Changes apply to following rules:
1. System includes before local includes
2. Function declaration style: first template,
   then type and then function name + parameters.
   Each in an own line.