WIP. Added more options, added template library.