modified the index a lot to improve readability. Javascript code reduced into smaller modules for easy understanding. FEw glitches removed and code optimized

Signed-off-by: sachin <sachinbhat.as@gmail.com>