initial commit

@jambun would you take a quick look ? Still needs testing (i'm doing that now)