refactor server_binlog.php:1. split to functions 2. move function to server_bin_log.lib.php

1. split to functions
2. move function to server_bin_log.lib.php