import all libraries and reduce lib checking code. Fixes #1