Added safe_strlen wrapper function and updated to wordpress coding standards