Move methods to a separate library.

Refs #4959
Make sure the name of the initial library (libicinga) is not hard-coded.

Refs #4959