Made dagger package as a library

Should work as a library without much efforts.