Implement functionality

basic implementation, without any error handling (not that we ever wanted something like error handling)
Won't work in IE<9 and is only tested in chrome. Awesome!