Re-organized code

Placed script before closing body tag due to DOM loading issues and re-organized code in vampire.js for easier reading.