BUG: Added missing node references update to scene->AddNode methods
Fixes http://na-mic.org/Mantis/view.php?id=3539.
Problem was that node references were not updated in the scene when node->SetScene(scene) was called for the node before scene->AddNode(node).
A few more code fixes are also included (no functional change, just making the code cleaner).