added rudimentary documentation

Also added @export to ALL functions. Many of these shouldn't actually
have that.