Cleanup of code; method documentation; improved url param parsing.