Mel lain new topic ids

Use functions and avoid macros whenever possible. One big disadvantage of macro is that it's impossible to step into the macro in the debugger.