Clean up if/elseif syntax
Detect dev mode correctly

- Use Director::isDev()
- Eliminate call to deprecated ereg()