make require-able

wrap compiled func in require-able definition
write runtime to dir
move index to lib/