Added usage of readline. Added possibility for out of source build.