Add a 'type' attribute to buildings

The idea is that you should easily be able to tell a power plant and a
consumer-type building apart.
Correct some 'null' / 'undefined' inconsistencies
Remove an unnecessary function

Now that entities have a 'type' attribute, the isPowerplant() function
is redundant.