Made some cleaner code.

Made cap() a prototype of string so its no longer cap(str) and instead
str.cap()