Use pkgconfig to link against libsomsp

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Split big source file into smaller parts

Signed-off-by: Michael Heimpold <mhei@heimpold.de>