Cleaned up Javascript.
Added Sort By feature.