Move misc function to single file

####Vastly Affected Change####
There are many little functions defined in main.h, I move them into misc.h (miscellaneous) The comment in main.cpp already said "move somewhere else", but I think everyone is too busy to move them lol.
This is a vastly affected change, especially to files in components.
******
Actually during the modification, I used a python script to help me add the misc.h include to those files need it. First move function to misc.h, then call the python script, it will parse all files cause compile failed, then add `#include "misc.h"` in the proper place. Here is the script:
```
#!/usr/bin/env python
# encoding: utf-8

import sys
import os
from subprocess import Popen, PIPE, call
import re

makedir = "/home/yodalee/git/qucs/qucs/qucs"
cmd = ['make', '-k', '-j8']
addline = '#include "misc.h"\n'

files = set()

def fun_addline(path):
    buf = []
    lastline = 0
    with open(path) as f:
        buf = f.read().splitlines()

    # find last local include
    for linenum, line in enumerate(buf):
        if line.startswith("#include") and '"' in line:
            lastline = linenum + 1

    f = open(path, "w")
    for linenum, line in enumerate(buf):
        if linenum == lastline:
            f.write(addline)
        f.write(line + "\n")
    f.close()

p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
 # parse error
errormsg = str(stderr)
for line in errormsg.split('\\n'):
   if "error" in line and "undeclared identifier" in line:
       filename = line.split(':')[0]
       files.add(filename)
# auto add line
for root, dirs, filelist in os.walk(makedir):
    for editfile in filelist:
       # if file has error
       if editfile in files:
           print("process %s" % os.path.join(root, editfile))
           fun_addline(os.path.join(root, editfile))
```