Fix : #1269 #1271

Hi,

I've created a new file in order to factorize code a little regarding Exernal Command.

This pull request has to be merged with shinken-monitoring/mod-livestatus#34

I will merge  it in 1 week. Feel free to give a feedback before :)
Too dangerous bcause we need to merge the, i'll remove it too.