use Q.promised to make most functions accept promises