Added rudimentary new tab creation.

Added license. Cleaned up the key handling a bit.