Initial commit with code from gitorious
Removed trailing whitespace