Fixes 257

Move to new Defines and fixes __DIR__ till we get to php 5.4