[Done..?]Substation multifix MK I

First half of my multifix, should fix all known code errors. Also includes suggestions.

#6257 

//EDIT:
Adding more things, as i am working on two computers, i am pushing partially unfinished feature in next PR. Please do not merge until i finish it, thank you.

//EDIT2:
According to testing it's running fine. Should not have any significant bugs.