Initial commit, very lightly tested. Use with caution.