Code, Example Scripts, Documentation

Added new code with better comments, some example scripts, and added
basic documentation.