Fixing symlink creation

@Anahkiasen this is a big one. Review it, but I think it's a good patch. If you don't understand something I did, feel free to ask!
Ok.. Because PSR-2 says nothing about var names