Make parser reentrant, read config from file

To make things work nicer, make it tread safe, make it possible to
change source and so on.

Signed-off-by: Max Sikstrom <msikstrom@op5.com>