How do I calculate sunrise/sunset times for non-Earth planets?

I am trying to create a world, and I don't like to do things halfway. So I am starting from scratch: new star, new planet. I plan to keep them similar to Earth, but not exactly, which means I can't just use Earth data for sunrise/sunset and moonrise/moonset times, like I could find here: http://aa.usno.navy.mil/data/docs/RS_OneYear.php.

What I am hoping to get is some sort of algorithm that would allow me to calculate these times for any planet, hopefully using custom time scales.

Input variables would include:
• velocity of revolution
• rotational velocity
• orbit as defined by Keplerian orbital elements (length of year being calculated from ellipse size and velocity of revolution.)
• axial tilt
• distance at aphelion and perihelion (Those are probably already defined by the Keplerian orbit. Is that correct?)
• planet radius (Does this matter, or is rotational velocity the only relevant input for day length?)
• Time unit length (As in, having a planet where the inhabitants' hour is not the same length of time as our hour. In other words, I would like to use custom time units, and define day length in terms of them.)
• probably more because I don't understand enough

I would also like to be able to calculate the points of sunrise/sunset and the arc that the sun would take through the sky.

Does anyone know of a program that would allow me to do this, and hopefully create tables such as the one in the link I posted? Or perhaps a planetary simulation program that would at least allow me to account for everything except point 7? I'm willing to be flexible on that, because it's likely more trouble than it's worth. Or perhaps there is someone on this forum with enough knowledge in astrophysics and programming to create such a program (unlikely, but I thought I'd ask)? Even a set of equations that would require manual solving would be a start.

Or am I mad to even consider attempting this level of detail for the sake of a fictional world?

Oh, and did I mention that it's in a binary star system, so I have an extra star whose positioning over time I will also need to track?

Anyway, hope my request is clear. Please ask for any clarification you need.