First commit by js21. Added test to check if library_type option is working