Cleaned up function notation

made function names follow the notation of the standard Lua functions,
reindented code, and removed a redundant assert
Fixed documentation

documentation now matches new notation