For the last bit try:
{if $products[product].avail > 0}
show add to cart button
{else}
show out of stock
{if}
For the quantity side of things, you could alway put in a drop down field with the quantity to add to the cart. The field must be named amount though.