Support attaching and detaching libraries, added documentation (closes #1)